<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\common\model\jooj_member;

class MemberInfo extends Base {

    protected $connection = ['database' => 'jooj_member'];
    protected $table = 'jj_member_info';

    /**
     * 构造方法，创建不同分表的模型
     * @param int $companyId 集团ID
     */
    public function __construct($companyId = 0) {
        if (!is_array($companyId)) {
           $companyId && $this->table .= '_' . $companyId;
        }
        $companyId = is_array($companyId) ? $companyId : [];
        parent::__construct($companyId);
    }
    
    public function get_vip_info_by_union_id($unionId) {
       return $this->where(['wx_unionid' => $unionId])->find();
    }
    
    
}

